package com.winnie;

import com.winnie.bean.ResponseEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.ShiroException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理器
 */
@RestControllerAdvice
@Slf4j
public class MyException {
    @ExceptionHandler(ShiroException.class)
    public ResponseEntity shiroException(ShiroException e){
        return ResponseEntity.error("shiro权限验证异常",e.toString());
    }
}
